
package ch.hearc.coursJava.IO.RMI.exemple0.pcB.moo;

import java.io.Serializable;
import java.net.InetAddress;
import java.rmi.RemoteException;

import com.bilat.tools.reseau.rmi.RmiTools;

public class Secret implements Secret_I, Serializable
	{

	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/

	public Secret() throws RemoteException
		{
		RmiTools.shareObject(this, PORT, ID);
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	@Override
	public String getSecret()
		{
		return "Voici mon secret!";
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/
	/*------------------------------*\
	|*			  Static			*|
	\*------------------------------*/

	public static final int PORT = RmiTools.getPortDefaultRMI();
	public static final InetAddress IP = RmiTools.getLocalHost();
	public static final String ID = "SecretID";

	}
